ecm_add_tests(alternativesmodeltest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::Purpose KF5::ConfigCore)
ecm_add_tests(menutest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::PurposeWidgets)

set(bindest "${CMAKE_BINARY_DIR}/bin/qml")
set(qml2ImportPath "$ENV{QML2_IMPORT_PATH}")
if (WIN32)
   set(PATHSEP ";")
else()
   set(PATHSEP ":")
endif()
if (qml2ImportPath)
   set(qml2ImportPath "${bindest}${PATHSEP}${qml2ImportPath}")
else()
   set(qml2ImportPath "${bindest}")
endif()
set_property(TEST menutest PROPERTY ENVIRONMENT QML2_IMPORT_PATH=${qml2ImportPath} APPEND)
set_property(TEST alternativesmodeltest PROPERTY ENVIRONMENT QML2_IMPORT_PATH=${qml2ImportPath} APPEND)
set_property(TEST menutest PROPERTY ENVIRONMENT KDE_PURPOSE_LOCAL_JOBS=1 APPEND)
set_property(TEST alternativesmodeltest PROPERTY ENVIRONMENT KDE_PURPOSE_LOCAL_JOBS=1 APPEND)
